<template>
  <div>
    <common
      :deviceserial="deviceserial"
      :title="title"
      :valiPage="valiPage"
      :device="device"
      :accessToken="accessToken"
      :addressCode="addressCode"
    ></common>
  </div>
</template>
<script>
import common from "./commonpoint.vue";
export default {
  name: "list1",
  components: {
    common
  },
  data() {
    return {
      title: "积水点 03",
      valiPage: [],
      valiList: [],
      name: "",
      device: { waterLeavel: 4 },
      accessToken: "", //授权过程获取的access_token
      deviceserial: "", //设备序列号,存在英文字母的设备序列号，字母需为大写  Y
      addressCode: ""
    };
  },
  created() {
    var that = this;
    that.$http
      .post("device/indexFindByMenuUrl", {
        url: that.$route.fullPath
      })
      .then(res => {
        that.device = res.data;

        that.$http
          .post("deviceCamera/findByStationId", {
            stationId: that.device.stationId
          })
          .then(res => {
            console.log("vo", res);
            that.valiList = res.data;
            that.valiList.forEach(item => {
              item.endTime = `https://open.ys7.com/ezopen/h5/iframe_se?url=${item.videoAddress}&accessToken=${item.accessToken}`;
              that.accessToken = item.accessToken;
              that.deviceserial = item.cameraNumber;
            });
            that.valiPage = that.valiList;
          });
        console.log("res", res);
      });
  },
  methods: {}
};
</script>